package demo.dao.ibatis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

import demo.dao.DemoDao;
import demo.model.User;

@Repository
public class DemoDaoIBatisImpl extends SqlMapClientDaoSupport implements DemoDao{
	@Autowired
	public void setSqlMapClient0(SqlMapClient sqlMapClient){
		super.setSqlMapClient(sqlMapClient);
	}
	public User getUserInfo(String userName) {
		return (User) getSqlMapClientTemplate().queryForObject("getUserInfoByUsername", userName);
	}

	public void deleteUserInfo(String userName) {
		getSqlMapClientTemplate().delete("deleteUserInfo", userName);
	}

	public void insertUserInfo() {
		getSqlMapClientTemplate().insert("insertUserInfo");
	}

}
